﻿

using Microsoft.AspNetCore.Http;

namespace Simple.Services
{
    public class CourseInputModel : ModelBase
    {
        /// <summary>
        /// 主键
        /// </summary>
        public Guid? Id { get; set; }

        /// <summary>
        /// 幼儿姓名
        /// </summary>
        [Required(ErrorMessage = "课程名称不能为空")]
        public string? CourseName { get; set; }

        /// <summary>
        /// 课程分类Id
        /// </summary>
        [Required(ErrorMessage = "课程分类不能为空")]
        public Guid? CourseTypeId { get; set; }

        /// <summary>
        /// 讲师id
        /// </summary>
        [Required(ErrorMessage = "讲师不能为空")]
        public Guid? LecturerId { get; set; }

        /// <summary>
        /// 课程来源
        /// </summary>
        [Required(ErrorMessage = "课程来源不能为空")]
        public EnumCourseSource Coursesource { get; set; }

        /// <summary>
        /// 时长（分钟）
        /// </summary>
        [Required(ErrorMessage = "时长不能为空")]
        public double Duration { get; set; }

        /// <summary>
        /// 文件
        /// </summary>
        public IFormFile? File { get; set; }

        /// <summary>
        /// 视频id
        /// </summary>
        public string? VideosId { get; set; }

        /// <summary>
        /// 视频链接
        /// </summary>
        public string? VideosLink { get; set; }

        /// <summary>
        /// 是否启用
        /// true--启用
        /// </summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 介绍
        /// </summary>
        public string? Description { get; set; }

        public override void ConfigureMapper(Profile profile)
        {
            profile.CreateMap<Course, CourseInputModel>();

            profile.CreateMap<CourseInputModel, Course>();

        }
    }

    public class ChangeEnableDto
    {
        public Guid? Id { get; set; }

        public bool IsEnable { get; set; } = true;
    }
}
